<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a th:if="${flag == 'yes'}" th:href="@{http://www.baidu.com}">百度</a>
<a th:unless="${flag == 'no'}" th:href="@{http://www.sougou.com}">搜狗</a>

<hr />

<div th:switch="${sex}">
    <p th:case="woman">它是一个姑娘</p>
    <p th:case="man">它是一个爷们</p>
    <p th:case="*">孤儿海</p>
</div>
</body>
</html>